public class PrimeNumber
    {
            public static void main(String[] args){
                    
                    int[] a = new int[205];
                    for (int i = 2; i <= 200; i++)
                            if (a[i] == 0)
                                    for (int j = 2; j * i <= 200; j++)
                                            a[j * i] = 1;
                    
                    int counter = 0;
 
                  
                    for (int i = 2; i <= 200; i++){
                           
                            if (a[i] == 0){
                                   
                                    if (counter != 0)
                                            System.out.print(" ");
                                   
                                    System.out.print(i);
                                   
                                    counter++;
                            }
                           
                            if (counter == 5){
                                    
                                    System.out.println();
                                   
                                    counter = 0;
                            }
                    }
            }
    }
